﻿using System;
using System.Web.UI;
using CuoiHoi.Business;
using CuoiHoi.Entities;
using System.Web.Routing;

namespace CuoiHoi
{
    public partial class Album_Anh : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
 
            try
            {
                Route myRoute = RouteData.Route as Route;
                ETheLoai theloai = BTheLoai.SelectByDuongDan(myRoute.Url);

                if (theloai != null)
                {
                    Page.Title = theloai.Title;
                    Page.MetaDescription = theloai.Description;
                    Page.MetaKeywords = theloai.Keyword;
                }

                PlaceHolder1.Controls.Clear();
                if (RouteData.Values["Id"] != null)
                {
                    PlaceHolder1.Controls.Add(LoadControl("~/UserControls/ChiTietAlbumAnh.ascx"));
                }
                else
                    PlaceHolder1.Controls.Add(LoadControl("~/UserControls/AlbumAnh.ascx"));
            }
            catch {
                Response.RedirectToRoute("Error");
            }
        }
    }
}